package com.zhang.comm.constant;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * @描述：全局常量
 * @创建时间：2021/1/14 16:13
 * </pre>
 **/
public final class BaseConstant {
    /**
     * 参数检查白名单地址列表
     */
    public static final List<String> PARAM_FILTER_WHITE_LIST = new ArrayList<>();
    /**
     * 令牌检查白名单地址列表
     */
    public static final List<String> TOKEN_FILTER_WHITE_LIST = new ArrayList<>();

    static {
        PARAM_FILTER_WHITE_LIST.add("/api/hms/*");
        TOKEN_FILTER_WHITE_LIST.add("/api/hms/*");
    }

    /**
     * 日志链路追踪id
     */
    public static final String LOG_TRACE_ID = "logTraceId";

    /**
     * 请求数据存放
     */
    public static final String REQUEST_DATA = "REQUEST_DATA";

    /**
     * 签名key
     */
    public static final String SIGN_KEY = "DXIH-APIKey+GWJJBOP4CHYPSK9Jhw5Fh0TbTF2WNPpv";
    /**
     * 加密key
     */
    public static final String SECRET_KEY = "DXIH@+h78957T2rJ";

    /**
     * 密码错误次数限制次数
     */
    private static final int PWD_ERROR_TIMES_LIMIT = 5;
    /**
     * key有效时间，分钟为单位
     */
    private static final int PWD_ERROR_TIMES_KEY_TTL = 10 * 60;
    /**
     * 中文 ·
     */
    public static final String NAME_REGX = "^[\\u4E00-\\u9FA5\\·•]{1,25}$";


    /**
     * 数字、中文、字符  2-30 长度
     */
    public static final String ADDR_REGX = "^[\\u4E00-\\u9FA5A-Za-z0-9\\s\\(\\)（）\\-——_【】\\[\\]]{1,60}$";


    /**
     * 18位身份证
     */
    public static final String CARD_REGX = "^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$|^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$";

    /**
     * 11位手机号
     */
    public static final String PHONE_REGX = "^(1[3-9])\\d{9}$";

    /**
     * 强密码限制(要求密码长度8-30位,必须为字母大小写+数字组合,可以用特殊字符)
     */
    public static final String STRONG_PWD_REGX = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9-*/+.~!@#$%^&*()]{8,30}$";

    /**
     * 同步给海港挂号记录的URI
     */
    public static final String SEND_REGISTER_URI = "/internetHospital/mobileRegister/addRegistrationInfo";

    /**
     * 同步给海港取消挂号记录的URI
     */
    public static final String SEND_CANCEL_URI = "/internetHospital/mobileRegister/updateRegistrationInfo";

    /**
     * 补偿推送给海港挂号记录的URI
     */
    public static final String PUSH_REGISTER_URI = "/internetHospital/mobileRegister/pushRegistrationInfo";


    /**
     * 延时检查支付状态topic(不能使用冒号来区分前缀，会与mq中的用法冲突)
     */
    public static final String CHECK_PAY_STATUS_TOPIC = "checkPayStatus-topic-hksdsrmyy";

    /**
     * 支付topic
     */
    public static final String PAY_TOPIC = "pay-topic-hksdsrmyy";

    public static final String PAY_CONSOMER = "pay-consumer";

    public static final String PAY_DRUG_PAY_CONSOMER = "pay-drug-pay-consumer";

    public static final String PAY_INQUIRY_PAY_CONSOMER = "pay-inquiry-pay-consumer";

//    /**
//     * 挂号支付topic
//     */
//    public static final String REGISTER_PAY_TOPIC = "pay-topic:registerPay";
//
//    /**
//     * 门诊缴费支付topic
//     */
//    public static final String OUTPATIENT_PAY_TOPIC = "pay-topic:outpatientPay";
//
//    /**
//     * 住院押金支付topic
//     */
//    public static final String DEPOSIT_PAY_TOPIC = "pay-topic:depositPay";

    /**
     * 在线问诊支付topic
     */
    public static final String INQUIRY_PAY_TOPIC = "pay-topic:inquiryPay";
    /**
     * 在线问诊药品支付topic
     */
    public static final String INQUIRY_DRUG_PAY_TOPIC = "pay-topic:drugPay";
    /**
     * 在线问诊项目支付topic
     */
    public static final String INQUIRY_PROJECT_PAY_TOPIC = "pay-topic-hksdsrmyy:projectPay";

    /**
     * 退款topic
     */
    public static final String REFUND_TOPIC = "refund-topic-hksdsrmyy";

    /**
     * 处方审核短信topic
     */
    public static final String PRESCRIPT_REVIEW_SMS_TOPIC = "prescript-review-sms-topic-hksdsrmyy";

    public static final String PRESCRIPT_REVIEW_SMS_CONSUMER = "prescript-review-sms-consumer";

    /**
     * 退款回调通知topic
     */
    public static final String REFUND_TOPIC_NOTIFY_TOPIC = "refund-topic-notify-topic-hksdsrmyy";

    public static final String REFUND_TOPIC_NOTIFY_CONSUMER = "refund-topic-notify-consumer";

    public static final String REFUND_DRUG_PAY_NOTIFY_CONSUMER = "refund-drug-pay-notify-consumer";

    public static final String REFUND_INQUIRY_PAY_NOTIFY_CONSUMER = "refund-inquiry-pay-notify-consumer";

    /**
     * 微信消息推送topic
     */
    public static final String SEND_SUB_TOPIC = "sendSub";

    /**
     * 挂号支付消费者组
     */
    public static final String REGISTER_PAY_CONSUMER = "registerPay-consumer";

    /**
     * 门诊缴费支付消费者组
     */
    public static final String OUTPATIENT_PAY_CONSUMER = "outpatientPay-consumer";

    /**
     * 住院押金支付消费者组
     */
    public static final String DEPOSIT_PAY_CONSUMER = "depositPay-consumer";
    /**
     * 在线问诊支付topic
     */
    public static final String INQUIRY_PAY_CONSUMER = "inquiryPay-consumer";
    /**
     * 在线问诊药品支付topic
     */
    public static final String INQUIRY_DRUG_PAY_CONSUMER = "drugPay-consumer";
    /**
     * 在线问诊项目支付topic
     */
    public static final String INQUIRY_PROJECT_PAY_CONSUMER = "projectPay-consumer";

    /**
     * 延时检验支付结果消费者组
     */
    public static final String CHECK_PAY_STATUS_CONSUMER = "checkPayStatus-consumer";

    /**
     * 退款消费者组
     */
    public static final String REFUND_CONSUMER = "refund-consumer";

    public static final Map<String, String> CHARGE_TYPE_MAP = new HashMap<>();

    static {
//        CHARGE_TYPE_MAP.put("1", REGISTER_PAY_TOPIC);
//        CHARGE_TYPE_MAP.put("2", OUTPATIENT_PAY_TOPIC);
//        CHARGE_TYPE_MAP.put("3", DEPOSIT_PAY_TOPIC);
        CHARGE_TYPE_MAP.put("4",  BaseConstant.PAY_TOPIC + ":inquiryPay");
        CHARGE_TYPE_MAP.put("5", BaseConstant.PAY_TOPIC + ":drugPay");
        CHARGE_TYPE_MAP.put("6", INQUIRY_PROJECT_PAY_TOPIC);
    }


    private BaseConstant() {
    }
}

